package com.itheima.objectoutputstream;

import com.itheima.domain.Student2;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;

public class Test6 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
//        请定义main()方法，创建一个反序列化对象：ObjectInputStream，
// 将文件”test5_1.txt”的对象反序列化到程序中，并打印此对象。
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("test5_1.txt"));
        Object o = ois.readObject();
        Student2 s=(Student2)o;
        System.out.println(s);
    }
}
